package com.juanable.niubility.enums;

/**
 * 状态码枚举对象
 */
public enum ResCodeEnum {
    /**
     * 状态码枚举对象
     */
    CODE_SUCCESS(1000, "操作成功"),
    CODE_BUS_ERR(1001, "业务异常"),
    CODE_PARAM_ERR(1002, "参数异常"),
    CODE_SYS_ERR(1003, "系统异常"),
    CODE_OTHER_ERR(1004, "调用其他平台接口异常"),
    CODE_REQUEST_ERR(1005, "请求地址异常"),
    CODE_LOGIN_ERR(1006, "无效登录状态"),
    CODE_AUTHORIZATION_ERR(1007, "权限不足"),
    CODE_DISABLED(1008, "账号被禁用"),
    CODE_OPT_CODE_OPT_FREQUENT(1009, "操作频繁，请稍候再试");

    //用户端错误
    public static final String ERR_FORBIDDEN = "A0101";
    public static final String ERR_USER_UN_EXIST = "A0102";

    public static final String ERR_OPERATOR = "A0201";
    public static final String ERR_PARAM_NULL = "A0202";
    public static final String ERR_PARAM_UN_EXIST = "A0203";
    public static final String ERR_SESSION_EXPIRE = "A0204";
    public static final String ERR_DATA_UN_EXIST = "A0205";
    public static final String ERR_DATA_ALREADY_EXIST = "A0206";
    public static final String ERR_NEED_USER_CHECK = "A0301";


    //系统端错误

    public static final String ERR_CLASS_PASS = "B0201";
    public static final String ERR_IO_EXCEPTION = "B0202";
    public static final String ERR_DB_EXCEPTION = "B0203";

    //第三方调用错误

    public static final String ERR_REQUEST_FAIL = "C0101";
    public static final String ERR_REQUEST_TIMEOUT = "C0102";
    public static final String ERR_REQUEST_AUTH = "C0103";

    Integer value;
    String msg;

    ResCodeEnum(Integer value, String msg) {
        this.value = value;
        this.msg = msg;
    }

    public Integer getValue() {
        return value;
    }

    public String getMsg() {
        return msg;
    }
}
